<template>
    <div id="thumbsUp">
        <div class="display-inline p-5" v-for="thumbsUp in thumbsUps" :key="thumbsUp.id">
            <router-link to="#">
                <img class="img-circle" width="50" height="50" :src="thumbsUp.avatar">
            </router-link>
        </div>
    </div>
</template>

<script>
    import http from '../../../init/api/Http';
    export default {
        data () {
            return {
                thumbsUps: []
            };
        },
        props: {
            url: {type: String}
        },
        mounted () {
            let id = parseInt(this.$route.params.id);
            if (!id > 0) {
                this.$router.go(-1);
            }
            this.id = id;
            http.get(this.url + id, null, (response) => {
                let d = response.data;
                if (d.success === false) {
                    this.$router.go(-1);
                }
                this.thumbsUps = d.data.praise;
            });
        }
    };
</script>
